package com.smmisia.article.dto.partner;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.smmisia.article.dto.user.UserVO;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.List;

@Data
public class PartnerCenterDTO {
    /**
     * 发起人信息
     */
    private UserVO users;

    /**
     * 地点id
     */
    private List<Integer> spotIdList;

    /**
     * 图片
     */
    private List<String> imagesList;

    /**
     * 结伴id
     */
    private Long id;

    /**
     * 结伴标题
     */
    private String title;

    /**
     * 内容介绍
     */
    private String content;

    /**
     * 总人数
     */
    private Integer count;

    /**
     * 剩余人数
     */
    private Integer residual;

    /**
     * 发起地点
     */
    private String location;

    /**
     * 1.预定,2.准备,3.游玩,4.结束
     */
    private Integer status;

    /**
     * 结束时间
     */

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime endTime;

    /**
     * 发布时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8", shape = JsonFormat.Shape.STRING)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;
}